#ifndef __IHANDLER_H__
#define __IHANDLER_H__

#include <LoggingGlobal.h>

namespace logging
{
    // Forward declarations
    class IFormatter;
    class LogRecord;
    
    class IHandler
	{
	public:
	    IHandler();
	    virtual ~IHandler() {}
	    
	    virtual void 	close() 					= 0;
	    virtual void 	flush() 					= 0;
	    
	    virtual LogLevel 	logLevel() const 				= 0;
	    virtual void 	setLogLevel( LogLevel logLevel) 		= 0;

	    virtual void 	processRecord( const LogRecord & record ) 	= 0;

	    virtual bool 	ready() 					= 0;

	    IFormatter *	formatter();
	    void		setFormatter( IFormatter * formatter );

	protected:
	    IFormatter * m_formatter;	    
	};

    // Inline Implementations. 
    inline IHandler::IHandler() : m_formatter( 0 ) {}
    inline IFormatter * IHandler::formatter() 		
	{ return( m_formatter ); }
    inline void IHandler::setFormatter(IFormatter * formatter ) 	
	{ m_formatter = formatter; }
}
#endif // __IHANDLER_H__
